package com.net.xpay.core.enums;

import com.net.common.enums.base.StringEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

/**
 * 2020/5/7 16:46

 */
@Slf4j
@Getter
@AllArgsConstructor
public enum SafePayBatchStatus implements StringEnum<SafePayBatchStatus> {
    WAIT_ENSURE("WAIT_ENSURE", "待转账"),
    WAIT_TRANS("WAIT_TRANS", "转账处理中"),
    DEALING("DEALING", "银行处理中"),
    SUCCESS("SUCCESS", "批次全部处理成功"),
    PART_SUCCESS("PART_SUCCESS", "批次部分处理成功"),
    FAIL("FAIL", "全部处理失败"),
    DISUSE("DISUSE", "批次废弃"),
    ;



    private String value;

    private String desc;

    public static boolean isFinalStatus(SafePayBatchStatus status) {
        return status == SUCCESS || status == PART_SUCCESS || status == FAIL  || status == DISUSE;
    }
}
